package com.xunk.auth.api.factory;

import com.xunk.auth.api.RemoteAuthService;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteAuthFallbackFactory implements FallbackFactory<RemoteAuthService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteAuthFallbackFactory.class);

    @Override
    public RemoteAuthService create(Throwable throwable) {
        log.error("鉴权token失败", throwable);
        return token -> null;
    }
}
